﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 白盒测试_路径覆盖_实验题2
{
	class Program
	{
		static void Main(string[] args)
		{
			int[] array = {1,2};
			SelectSort(array);

			for (int i = 0; i < array.Length; i++)
			{
				Console.Write(array[i] + " ");
			}

			Console.ReadLine();
		}

		public static void SelectSort(int[] array)
		{
			int temp = 0;
			int length = 0;

			length = array.Length;

			for (int i = 0; i < length - 1; i++)
			{
				int k = i;

				for (int j = i + 1; j < length; j++)
				{
					if (array[j] < array[k])
					{
						k = j;
					}
				}

				if (i != k)
				{
					temp = array[k];
					array[k] = array[i];
					array[i] = temp;
				}
			}
		}
	}
}
